package com.zc.zby.basicframedemo.activity;

import android.os.Bundle;

import com.jude.easyrecyclerview.EasyRecyclerView;
import com.zc.zby.basicframedemo.R;
import com.zc.zby.basicframedemo.adapter.TableAdapter;
import com.zc.zby.basicframedemo.base.BaseActivity;
import com.zc.zby.basicframedemo.model.TableModel;
import com.zc.zby.basicframedemo.weight.FullyLinearLayoutManager;

import java.util.ArrayList;

import butterknife.BindView;

public class TableActivity extends BaseActivity {
    @BindView(R.id.VRecyclerView)
    EasyRecyclerView mEasyRecyclerView;
    private ArrayList<TableModel> tableModels = new ArrayList<>();
    private TableAdapter tableAdapter;

    @Override
    public int getLayoutId() {
        return R.layout.activity_table;
    }

    @Override
    public void initViews(Bundle savedInstanceState) {
        tableAdapter = new TableAdapter(this);
        mEasyRecyclerView.setLayoutManager(new FullyLinearLayoutManager(this));
        mEasyRecyclerView.setAdapter(tableAdapter);
    }

    @Override
    public void setListeners() {

    }

    @Override
    public void initToolBar() {

    }

    @Override
    public void initData() {
        for (int i = 0; i < 20; i++) {
            TableModel tableModel = new TableModel();
            tableModel.table = "标题 " + i;
            tableModels.add(tableModel);
        }
        tableAdapter.addAll(tableModels);
    }
}
